
import { MeshRenderer } from 'cc';
import { Material } from 'cc';
import { _decorator, Component} from 'cc';
import { App } from '../../App';
const { ccclass, property } = _decorator;

/* 游戏名字 */
@ccclass('GameName')
export class GameName extends Component {
    @property(Material)
    MaterialArr = []

    onLoad(): void {
        
    }

    start() {
        let namemeshRenderer:MeshRenderer = this.node.getComponent(MeshRenderer)

        let index = 0
        if (App.fightMode == App.fightMode_1) {
            index = 0
        }else if (App.fightMode == App.fightMode_2) {
            index = 1
        }else if (App.fightMode == App.fightMode_3) {
            if (App.Model.gameManage.gameStartData.gameType==0){
                index = 2
            }else {
                index = 3
            }
        }else if (App.fightMode == App.fightMode_4) {
            index = 4
        }

        namemeshRenderer.setMaterial(this.MaterialArr[index], 0);
    }

}

